package com.xsdl.state.pattern;

import com.xsdl.state.State;

public class SuperMarioStateService implements MarioStateService {

    private static final SuperMarioStateService instance = new SuperMarioStateService();

    public static MarioStateService getInstance() {
        return instance;
    }

    @Override
    public void obtainMushRoom(MarioStateMachine stateMachine) {

    }

    @Override
    public void obtainCape(MarioStateMachine stateMachine) {
        stateMachine.setCurrentStateService(CapeMarioStateService.getInstance());
        stateMachine.setScore(stateMachine.getScore() + 200);
    }

    @Override
    public void obtainFireFlower(MarioStateMachine stateMachine) {
        stateMachine.setCurrentStateService(FireMarioStateService.getInstance());
        stateMachine.setScore(stateMachine.getScore() + 300);
    }

    @Override
    public void meetMonster(MarioStateMachine stateMachine) {
        stateMachine.setCurrentStateService(SmallMarioStateService.getInstance());
        stateMachine.setScore(stateMachine.getScore() - 100);
    }

    @Override
    public State getState() {
        return State.SUPER;
    }
}
